<h3>Danh mục</h3>
<hr>
<script type="text/javascript">	
  	function doDelete() {		
  		answer = confirm("Bạn chắc chắn muốn xóa danh mục này?");		
  		if(answer) {			
  			document.getElementById('frm_delete').submit();		
  		}	
  	}
 </script> 
  
<div style="height: 38px; border-bottom: 1px solid grey; margin-bottom: 20px; padding-right: 30px; ">
	<a onclick = "doDelete()" href="#" style="float: right">
		<img src="<?php echo base_url()?>template/images/btn_delete.png" border="0" />
	</a>
	<a href="<?php echo base_url()?>index.php/category/add"  style="float: right; margin-right: 20px">
		<img src="<?php echo base_url()?>template/images/btn_add.png" border="0" />
	</a>
	<div class="clear: right"></div>
</div>

<form action="<?php echo base_url().'index.php/category/delete'?>" method="post" enctype="multipart/form-data" id="frm_delete">
<table class="list" width="100%" cellpadding="5">
	<tr style="color: #fff; font-weight: bold" bgcolor="#ad2f33" >
		<td align="center">
			<input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" />
		</td>
		<td>ID</td>
		<td>Tên danh sách</td>
		<td>Mô tả</td>
		<td>Hành động</td>
	</tr>
	<?php if ($category) { ?>
    <?php $class = 'odd_row_style'; ?>
    <?php foreach ($category as $cate) { ?>
    <?php $class = ($class == 'even_row_style' ? 'odd_row_style' : 'even_row_style'); ?>
      
      <tr class="<?php echo $class; ?>">
		<td align="center"><input type="checkbox" name="selected[]" value="<?php echo $cate['id']; ?>" /> </td>
    	<td align="center">
    			<?php echo '<p>' . $cate['id'] . '</p>' ?>
    	</td>
    	<td><?php echo $cate['categoryName'] ?></td>
        <td><p><?php echo $cate['description']?></p></td>
        
        
        
    	<td align="center">
    		<!--  a href="<?php echo base_url().'index.php/customer/'. $customer['id'] ;?>">Xem-->
    		<a href="<?php echo base_url().'index.php/category/update/'.$cate['id']?>">Sửa</a>
    	</td>
    </tr>
    <?php } ?>
	<?php } ?>
</table>
</form>